<div class="panel panel-default">
  <div class="panel-heading"><?= empty($data) ? '添加题库' : '编辑题库' ?></div>
  <div class="panel-body">
    <form action="" method="post" class="form-horizontal">
      <fieldset>
        <?php if (!empty($data)): ?>
          <input type="hidden" name="bank_id" value="<?= $data->bank_id ?>">
        <?php endif ?>
        <div class="form-group">
          <label for="name" class="control-label col-md-1">题库名称</label>

          <div class="col-md-2">
            <input type="text" name="name" id="name" maxlength="40" required="" value="<?=CHtml::encode($data->name)?>" autofocus=""
                   placeholder="请输入题库名称" class="form-control">
          </div>
        </div>
        <div class="form-group">
          <label for="duration" class="control-label col-md-1">测试时长</label>
          <div class="col-md-2">
            <input type="number" name="duration" id="duration" maxlength="3" required="" value="<?=CHtml::encode(empty($data->duration)?30:$data->duration)?>" min="1" max="120"
                   placeholder="请输入测试时长" class="form-control">
            <div class="help-block">单位：分钟</div>
          </div>
        </div>
        <div class="form-group">
          <div class="col-md-2 col-md-offset-1">
            <button type="submit" class="btn btn-primary btn-block">提交</button>
          </div>
        </div>
      </fieldset>
    </form>
  </div>
</div>